package cn.mw.cmdb.mapper;

import cn.mw.cmdb.entity.instanceToPo.InstanceRelation;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface InstanceRelationMapper extends Neo4jRepository<InstanceRelation, Long> {

    @Query("MATCH (n)-[r:instanceRelation]->() WHERE n.id=$id DELETE r")
    void deleteInstanceRelationByInstanceId(@Param(value = "id") String id);
}
